package com.cnzhy.sharding.mapper;

import com.cnzhy.sharding.entity.CrmAdminUser;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author: zhaoyan5
 */
@Mapper
public interface CrmAdminUserMapper {
    /**
     * delete by primary key
     *
     * @param userId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Long userId);

    /**
     * insert crmAdminUser to table
     *
     * @param crmAdminUser the crmAdminUser
     * @return insert count
     */
    int insert(CrmAdminUser crmAdminUser);

    /**
     * insert crmAdminUser to table selective
     *
     * @param crmAdminUser the crmAdminUser
     * @return insert count
     */
    int insertSelective(CrmAdminUser crmAdminUser);

    /**
     * select by primary key
     *
     * @param userId primary key
     * @return object by primary key
     */
    CrmAdminUser selectByPrimaryKey(Long userId);

    /**
     * update crmAdminUser selective
     *
     * @param crmAdminUser the updated crmAdminUser
     * @return update count
     */
    int updateByPrimaryKeySelective(CrmAdminUser crmAdminUser);

    /**
     * update crmAdminUser
     *
     * @param crmAdminUser the updated crmAdminUser
     * @return update count
     */
    int updateByPrimaryKey(CrmAdminUser crmAdminUser);

    /**
     * update user_name
     *
     * @param userId
     * @param userName
     */
    void updateUserNameByUserId(Long userId,String userName);

    /**
     *
     * @return
     */
    List<CrmAdminUser> findAll();
}
